import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import {useState} from 'react';
import DataForm from './components/DataForm';

const Right = props => {

  const {selectedRow} = props.data;
  const [tablePayload, setTablePayload] = useState({page: 1, size: 15, param: {}});
  const [dataForm, setDataForm] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <DataForm data={{dataForm, setDataForm, tablePayload, setTablePayload, selectedRow}}/>
      <SearchForm data={{tablePayload, setTablePayload}}/>
      <DataTable data={{setDataForm, tablePayload, setTablePayload, selectedRow}}/>
    </div>
  );
};

export default Right;
